<!DOCTYPE html>
<html lang="en" xmlns:th="https://www.thymeleaf.org">
<head>
  <meta charset="UTF-8">
  <title>LoginByName</title>
  <link rel="StyleSheet" href="../css/login.css" type="text/css" media="screen" />
  <link rel="StyleSheet" href="../css/common.css" type="text/css" media="screen" />
  <link rel="stylesheet" href="../css/pet-store-plus.css">
  <script src="/js/58cb2985af.js"></script>
<!--  <script src="https://kit.fontawesome.com/58cb2985af.js" crossorigin="anonymous"></script>-->
</head>
<!--基本所有的href还没填-->
<body>
<!--头部-->
<div id="topbar">
  <div id="LogoContent">
<!--    <a href="" >logo</a>-->
                <a> <img src="../images/logo-topbar.gif" /></a>
  </div>
  <div>
  </div>
</div>
<div class="sidebar" id="sidebar">
</div>

<div class="content" id="content">
  <div style="grid-column: span 1;grid-row: span 8"></div>
  <div id="w" >
    <div class="loginContent">

      <div class="loginTitle">
        <a id="btn1" class="btn" href="/admin/login" role="button">Account Login</a>
        <a class="btn" href="/admin/login2" role="button">SMS Login</a>
      </div>
      <form class="loginForm" action='/admin/loginByName' method="post">
        <div class="loginFormItem">
          <label for="username" class="loginFormLabel">
            <i class="fa-solid fa-user"></i>
          </label>
          <input type="text" class="loginFormInput" name="username" id="username" placeholder="Please enter username">
        </div>

        <div class="loginFormItem">
          <label for="password" class="loginFormLabel">
            <i class="fa-solid fa-lock"></i>
          </label>
          <input type="password" class="loginFormInput" name="password" id="password" placeholder="Please enter password">
        </div>

        <div class="loginFormItem">
          <label for="code" class="loginFormLabel">
            <i class="fa-solid fa-shield-halved"></i>
          </label>
          <div  class="codeGroup">
            <input type="text" class="loginFormInputCode" name="code" id="code" placeholder="Please enter verification">
            <!--                    图片验证码-->
            <img alt="单击图片刷新！" class="pointer" src="/common/kaptcha"
                 onclick="this.src='/common/kaptcha?d='+new Date()*1">
          </div>

        </div>

        <div class="loginFormLink">
          <p th:if="${errorMsg}" th:text="${errorMsg}" style="color: red;"></p>
        </div>

        <div class="loginFormItemSubmit">
          <input type="submit" class="loginFormSubmit" value="Login">
        </div>

        <div class="loginFormLink">
          <a href="/admin/registerForm" class="link2">no Account? go register</a>
        </div>
      </form>
    </div>
  </div>
</div>

<script>
  window.addEventListener('load',function (){
    // const erroeMsg= /*[[${session.errorMsg}]]*/ null;
    // console.log('errorMsg='+errorMsg);
  })
</script>

</body>
</html>